﻿#ifndef PRODUCTPLANSTANDARDITEMMODEL_H
#define PRODUCTPLANSTANDARDITEMMODEL_H

#include <QStandardItemModel>
#include "product.h"

class ProductPlanStandardItemModel : public QStandardItemModel
{
    Q_OBJECT
public:
    explicit ProductPlanStandardItemModel(QObject *parent = nullptr);

    QStringList header;

    bool setData(const QModelIndex &index, const QVariant &value, int role) override;

    QVariant data(const QModelIndex &index, int role) const override;

    void reset();

    void insertProduct(Product &product, double taxRate);

    void insertProduct(QList<Product*> products);
signals:

public slots:

private:
    QList<Product*> products;
};

#endif // PRODUCTPLANSTANDARDITEMMODEL_H
